package com.spark.lola.logistics.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.spark.lola.logistics.constant.LogisticsConstant;
import com.spark.lola.statistics.entity.StatisticsDriver;
import com.spark.lola.support.common.constant.CommonConstant;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.mybatis.entity.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author: Zhi-peng wang
 * @date: 2020/04/24 09:55
 * 驾驶员信息
 **/
@Getter
@Setter
@ApiModel(value = "DriverInfo", description = "驾驶员信息")
@TableName("logistics_driver_info")
public class DriverInfo extends BaseModel {

    @ApiModelProperty(name = "empId", value = "管理员id")
    private Long empId;

    @ApiModelProperty(name = "carId", value = "车辆id")
    private Long carId;

    @ApiModelProperty(name = "realName", value = "真实姓名")
    private String realName;

    @ApiModelProperty(name = "isBind", value = "是否绑定", notes = "0-未绑定，1-绑定")
    private Integer isBind = LogisticsConstant.CarIsBind.N_BIND;

    @ApiModelProperty(name = "drivingLicenceNo", value = "驾驶证号")
    private String drivingLicenceNo;

    @ApiModelProperty(name = "drivingLicenceIndate", value = "驾驶证有效期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date drivingLicenceIndate;

    @ApiModelProperty(name = "drivingLicence", value = "驾驶证原件")
    private String drivingLicence;

    @ApiModelProperty(name = "borrowingAmount", value = "借款金额")
    private BigDecimal borrowingAmount = BigDecimal.ZERO;

    @ApiModelProperty(name = "borrowingTime", value = "借款时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date borrowingTime;

    @ApiModelProperty(name = "used", value = "状态", notes = "Y-启用，N-禁用，W-待绑定")
    private String used = CommonConstant.Y;

    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

    @ApiModelProperty(name = "creator", value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @ApiModelProperty(name = "updator", value = "修改人")
    @TableField(fill = FieldFill.UPDATE)
    private String updator;

    @ApiModelProperty(name = "createTime", value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(name = "updateTime", value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(name = "carNo", value = "车牌号")
    @TableField(exist = false)
    private String carNo;

    @ApiModelProperty(name = "carName", value = "车辆别名")
    @TableField(exist = false)
    private String carName;

    @ApiModelProperty(name = "shiroUser", value = "驾驶员信息")
    @TableField(exist = false)
    private ShiroUser shiroUser;

    @ApiModelProperty(name = "statisticsDriver", value = "统计信息")
    @TableField(exist = false)
    private StatisticsDriver statisticsDriver;

}
